Skip to content

Add pretty printers for Statevec and DensityMatrix#503

Open
donglrd wants to merge 1 commit into
TeamGraphix:masterfrom
donglrd:pretty-print-statevec-density
Open

Add pretty printers for Statevec and DensityMatrix#503
donglrd wants to merge 1 commit into
TeamGraphix:masterfrom
donglrd:pretty-print-statevec-density

Conversation

@donglrd
Copy link
Copy Markdown

@donglrd donglrd commented May 12, 2026

Summary\n- add complex-number pretty formatting for fractions, square-root constants, and phase exponentials\n- add statevector ket expansion rendering via Statevec.draw()\n- add density-matrix outer-product rendering via DensityMatrix.draw()\n- cover the new formatting helpers and draw methods with tests\n\nCloses #501\n\n## Testing\n- pytest tests/test_pretty_print.py -q\n- python3 -m ruff check graphix/pretty_print.py graphix/sim/statevec.py graphix/sim/density_matrix.py tests/test_pretty_print.py

@thierry-martinez
Copy link
Copy Markdown
Collaborator

Thank you for your contribution! As noted in the preamble of #501, this issue is part of unitaryHACK 2026; therefore, contributions will be evaluated during the hackathon period, from June 3 to June 17, 2026.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants